package vo

import (
	"ylb/entity"
)

type UserLoginVo struct {
	Username string
	Password string
	Validate string
}

type UserInfoVo struct {
	entity.UserRelevance
	ID       uint   `json:"id"`
	NickName string `json:"nickName"`
	UserName string `json:"userName"`
	Describe string `json:"describe"`
	Image    string `json:"image"`
}
type UserRegisterVo struct {
	NickName string `json:"nickName"`
	UserName string `json:"userName"`
	Password string `json:"password"`
	Email    string `json:"email"`
	Validate string `json:"validate"`
}

func (userVo UserLoginVo) LoginVoParseUser() entity.User {
	return entity.User{

		UserName: userVo.Username,
		Password: userVo.Password,
	}
}
func (userVo UserRegisterVo) RegisterVoParseUser() entity.User {
	return entity.User{
		NickName: userVo.NickName,
		UserName: userVo.UserName,
		Password: userVo.Password,
	}
}
func UserParseInfoVo(user entity.User, relevance entity.UserRelevance) UserInfoVo {

	return UserInfoVo{
		ID:            user.ID,
		NickName:      user.NickName,
		UserName:      user.UserName,
		Describe:      user.Describe,
		Image:         user.Image,
		UserRelevance: relevance,
	}
}
